package com.cml.common.util;

/**
 * 姓名：陈茂林
 * 时间：2023/11/6 17:00
 * 描述：
 */
public class SoltMathUtil {
    /**
     * slot槽位的总数量
     */
    public static final int SLOTS_COUNT = 16384;

    public static Integer mathSolt(String serviceName){
        int hashCode = serviceName.hashCode() & Integer.MAX_VALUE;
        Integer slot = hashCode % SLOTS_COUNT;

        if(slot == 0) {
            slot = slot + 1;
        }
        return slot;
    }
}
